package com.ruoyi.system.service.impl;

import cn.hutool.core.util.ObjectUtil;
import com.ruoyi.system.dao.AreaDao;
import com.ruoyi.system.domain.dto.AreaDto;
import com.ruoyi.system.domain.vo.AreaVo;
import com.ruoyi.system.service.AreaService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class AreaServiceImpl implements AreaService {
    @Resource
    private AreaDao areaDao;

    @Override
    public List<AreaVo.AreaInfo> queryAreaHospital(AreaDto.QueryArea param) {
        if (ObjectUtil.isNull(param.getId())) {
            param.setId(0L);
        }
        return areaDao.queryByParentId(param.getId());
    }
}
